﻿using System;

/*
  Write a program that prints all the numbers from 1 to N, that are not divisible by 3 and 7 at the same time.
 */

class PrintNUndivisibleTo3And7
{
    static void Main(string[] args)
    {
        Console.Write("Enter N: ");
        int n = Int32.Parse(Console.ReadLine());
        for (int i = 1; i <= n; i++)
        {
            if ( i % (3*7) != 0 )
            {
                Console.WriteLine(i);
            }
        }
    }
}

